﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace @class
{
    class employee
    { //定义一个员工类，存放用户的工号、姓名和部门信息；
      //定义两个构造函数，一个是无参；
      //一个有参构造函数，对类的属性进行初始化。
        private int userid;
        private string name;
        private string department;

        public int Userid
        {
            get { return this.Userid; }
            set { this.userid = value; }
        }

        public string Name
        {
            get { return this.Name; }
            set { this.name = value; }
        }
        public string Department
        {
            get { return this.Department; }
            set { this.department = value; }
        }

        //无参
        public employee()
        {

        }
        public void emp()
        {
            Console.WriteLine("用户的工号为：{0} 姓名为：{1} 部门为：{2}", this.userid, this.name, this.department);
        }
        //有参
        public employee(int userid, string name, string department)
        {
            this.Userid = userid;
            this.Name = name;
            this.Department = department;
            Console.WriteLine("用户的工号为：{0} 姓名为：{1} 部门为：{2}", this.userid, this.name, this.department);
        }

    }
}
